﻿$(function($) {
        $("#check-disable").click(function() {
                if($(this).is(':checked')) {
                    $('.disable').hide("fast");
                } else {
                    $('.disable').show("fast");
                }
           }   
         );
});
function ChangeStatus(item, InputName) {
    var isdisable = $(item).parent().attr('data-disable');
    var msg_1 = '';
    var msg_2 = '';
    var data_disable = '';
    var addClass = '';
    //1 代表已启动 ；0 代表禁用
    switch (isdisable) {
        case '1':
            msg_1 = "已禁用 ";
            msg_2 = "启动";
            data_disable = 0;
            $(item).parent().parent().addClass('disable');
            $("input[name="+InputName+"]").attr('disabled', 'disabled');
            break;
        case '0':
            msg_1 = "已启动 ";
            msg_2 = "禁用";
            data_disable = 1;
            $(item).parent().parent().removeClass('disable');
            $("input[name="+InputName+"]").removeAttr('disabled');
            break;
    }
    $(item).text(msg_2);
    var html = msg_1+$(item).parent().html().substr(4);
    $(item).parent().attr('data-disable',data_disable);
    $(item).parent().empty().append(html);
}
